﻿using JNPF.Basics.Models;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace JNPF.Basics.Logic
{
    /// <summary>
    /// 操作权限
    /// 版 本：V3.0.0
    /// 版 权：引迈信息技术有限公司（https://www.jnpfsoft.com）
    /// 作 者：JNPF开发平台组
    /// 日 期：2017.11.07
    /// </summary>
    internal interface AuthorizeIService
    {
        /// <summary>
        /// 获取权限（菜单、按钮、列表）
        /// </summary>
        /// <param name="isAdmin">是否管理员</param>
        /// <param name="userId">用户主键</param>
        /// <returns></returns>
        Task<AuthorizeModel> GetAuthorize(bool isAdmin, string userId);

        /// <summary>
        /// 根据用户Id获取列表
        /// </summary>
        /// <param name="isAdmin">是否管理员</param>
        /// <param name="userId">用户主键</param>
        /// <returns></returns>
        Task<List<AuthorizeEntity>> GetListByUserId(bool isAdmin, string userId);
        /// <summary>
        /// 根据对象Id获取列表
        /// </summary>
        /// <param name="objectId">对象主键</param>
        /// <returns></returns>
        Task<List<AuthorizeEntity>> GetListByObjectId(string objectId);
        /// <summary>
        /// 创建
        /// </summary>
        /// <param name="entitys">实体对象</param>
        Task Create(List<AuthorizeEntity> entitys);
        /// <summary>
        /// 创建
        /// </summary>
        /// <param name="objectId">对象主键</param>
        /// <param name="entitys">实体对象</param>
        Task Create(string objectId, List<AuthorizeEntity> entitys);
        /// <summary>
        /// 创建
        /// </summary>
        /// <param name="objectId">对象主键</param>
        /// <param name="entitys">实体对象</param>
        Task CreatePortal(string itemId, List<AuthorizeEntity> entitys);

        /// <summary>
        /// 功能权限数据
        /// </summary>
        /// <param name="itemId">功能id</param>
        /// <param name="ObjectType">权限类别（Role）</param>
        Task<List<AuthorizeEntity>> GetAuthorizeModelList(string itemId, string ObjectType);
    }
}
